package com.imooc.exception;

import com.imooc.grance.result.ResponseStatusEnum;

/**
 * Created with IntelliJ IDEA.
 *
 * @auther Levi
 * @Date: 2021/03/14/14:14
 * @Description:
 * 自定义异常，统一处理异常信息
 *  用于解耦
 */
public class CustomerException  extends RuntimeException{
    private ResponseStatusEnum responseStatusEnum;

    public CustomerException(ResponseStatusEnum responseStatusEnum) {
        super("异常状态码:"+responseStatusEnum.status()+";"+"异常信息:"+responseStatusEnum.msg());
        this.responseStatusEnum = responseStatusEnum;
    }

    public ResponseStatusEnum getResponseStatusEnum() {
        return responseStatusEnum;
    }

    public void setResponseStatusEnum(ResponseStatusEnum responseStatusEnum) {
        this.responseStatusEnum = responseStatusEnum;
    }
}
